package org.zyx.item.api;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.zyx.item.entity.SpecGroup;
import org.zyx.item.entity.SpecParam;

import java.util.List;

/**
 * @Author: SwordMaple
 * @Date: 2020/9/6  20:18
 * @Description: 负责管理规格参数组及参数
 * @Version: 1.0
 */
public interface SpecificationApi {

    /**
     * 通过根据条件查找参数
     * @param gid
     * @return
     */
    @GetMapping("/spec/params")
    public List<SpecParam> findParams(
            @RequestParam(value = "gid",required = false) Long gid,
            @RequestParam(value = "cid",required = false) Long cid,
            @RequestParam(value = "generic",required = false) Boolean generic,
            @RequestParam(value = "searching",required = false) Boolean searching
            );

    /**
     * 通过cid查找分类组级参数
     * @param cid
     * @return
     */
    @GetMapping("/spec/group/param/{cid}")
    public List<SpecGroup> findGroupsWithParam(@PathVariable("cid") Long cid);

}
